package com.example.zhujiemian.xuanke;

import android.os.Bundle;

import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.example.zhujiemian.R;

import java.util.Arrays;
import java.util.List;

public class CourseSelectionActivity extends AppCompatActivity {
    private RecyclerView recyclerView;
    private CourseAdapter adapter;
    private List<Course> courseList;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_course_selection);

        recyclerView = findViewById(R.id.rv_courses);
        courseList = getCourses(); // Fetch or generate course list
        adapter = new CourseAdapter(courseList);
        recyclerView.setLayoutManager(new LinearLayoutManager(this));
        recyclerView.setAdapter(adapter);
    }

    private List<Course> getCourses() {
        // Dummy data for example
        return Arrays.asList(
                new Course("Mathematics"),
                new Course("Physics"),
                new Course("Chemistry"),
        new Course("Chemistry"),
        new Course("Chemistry"),
        new Course("Chemistry")
        );
    }
}